package test_package;

import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;

import java.util.concurrent.TimeUnit;

public class Sel1_google {
    @Test
    public static void SelTest () {
        WebDriver driver = new FirefoxDriver();
        driver.get("http://google.com.ua");
        WebElement query = driver.findElement(By.id("gbqfq"));
        driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
        query.sendKeys("TCH");
        query.submit();

        //WebElement aHrefs = driver.findElement(By.partialLinkText("ТСН.ua: Останні новини України, новини дня"));
        //aHrefs.click();

        //WebElement firstLink = driver.findElement(By.className("r"));
        //firstLink.findElement(By.tagName("a")).click();

        driver.findElement(By.className("r")).findElement(By.tagName("a")).click();     //monster command!!! ))
        driver.quit();

    }
    }
